import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import myPlugin from "./Plugin.js"
createApp(App).use(router).directive('highlight',{mounted(el,binding){
	let delay=0
	if(binding.modifiers.delayed){
		delay=3000
	}
	if(binding.modifiers.blink){
		let mainColor=binding.value.mainColor
		let secondColor=binding.value.secondColor
		let currentColor=mainColor
		setTimeout(()=>{
			setInterval(()=>{
				currentColor==secondColor?(currentColor=mainColor):(currentColor=secondColor)
				if(binding.arg==='background'){
					el.style.backgroundColor=currentColor
				}else{
					el.style.color=currentColor
				}
			},binding.value.delay)
		},delay)
	}else{
		setTimeout(()=>{
			if(binding.arg==="background"){
				el.style.backgroundColor=binding.value.mainColor
			}else{
				el.style.color=binding.value.mainColor
			}
		},delay)
	}
}}).use(myPlugin,{
	small:12,
	medium:24,
	large:36,
}).mount('#app')
